﻿using System;
using System.Collections.Generic;
using System.Threading;
namespace Program09
{
    class Program
    {
        //随机初始化不少于100个员工，随机生成一些中文姓名
        public static List<Person> GetPerson()
        {
            var list = new List<Person>();

            //100个员工
            for(int i=0;i<100;i++)
            {
                var fName = "";
                var lName = "";
                _GetRandomChineseName(ref fName, ref lName);
                var p = new Person()
                {
                    EmployeeNo = "Lzzy" + (i + 1).ToString("000"),
                    FirstName = fName,
                    LastName = lName,
                    Phone="15248"+i.ToString("000000")
                };
                list.Add(p);
                //延时一毫秒
                Thread.Sleep(1);
            }
            return list;
        }
        /// <summary>
        /// 随机生成中文姓名
        /// </summary>
        /// <param name="fName"></param>
        /// <param name="lName"></param>
        private static void _GetRandomChineseName(ref string fName, ref string lName)
        {
            string[] _fNames = new string[]
            {
                "白", "毕", "卞", "蔡", "曹", "岑", "常", "车", "陈", "成", "程", "池", "邓", "丁", "范", "方", "樊", "费", "冯", "符", "傅",
                "甘", "高", "葛", "龚", "古", "关", "郭", "韩", "何", "贺", "洪", "侯", "胡", "华", "黄", "霍", "姬", "简", "江", "姜", "蒋",
                "金", "康", "柯", "孔", "赖", "郎", "乐", "雷", "黎", "李", "连", "廉", "梁", "廖", "林", "凌", "刘", "柳", "龙", "卢", "鲁",
                "陆", "路", "吕", "罗", "骆", "马", "梅", "孟", "莫", "母", "穆", "倪", "宁", "欧", "区", "潘", "彭", "蒲", "皮", "齐", "戚",
                "钱", "强", "秦", "丘", "邱", "饶", "任", "沈", "盛", "施", "石", "时", "史", "司徒", "苏", "孙", "谭", "汤", "唐", "陶",
                "田", "童", "涂", "王", "危", "韦", "卫", "魏", "温", "文", "翁", "巫", "邬", "吴", "伍", "武", "席", "夏", "萧", "谢", "辛",
                "邢", "徐", "许", "薛", "严", "颜", "杨", "叶", "易", "殷", "尤", "于", "余", "俞", "虞", "元", "袁", "岳", "云", "曾", "詹",
                "张", "章", "赵", "郑", "钟", "周", "邹", "朱", "褚", "庄", "卓"
            };
            string _lNames = "根据国务院办公厅通知精神，2020年劳动节放假安排如下：请广大市民提前安排好工作生活，节日期间注意安全，度过一个欢乐、祥和的节日假期";

            var rnd = new Random(DateTime.Now.Millisecond);
            fName = _fNames[rnd.Next(_fNames.Length - 1)];
            lName = _lNames.Substring(rnd.Next(0, _lNames.Length - 1), 1) +
                _lNames.Substring(rnd.Next(0, _lNames.Length - 1), 1);
        }

        static void Main(string[] args)
        {
            //var firstName = "";
            //var lastName = "";
            //_GetRandomChineseName(ref firstName, ref lastName);
            //Console.WriteLine(firstName+lastName);

            //_GetRandomChineseName(ref firstName, ref lastName);
            //Console.WriteLine(firstName + lastName);

            //_GetRandomChineseName(ref firstName, ref lastName);
            //Console.WriteLine(firstName + lastName);
            //var p = new Person();
            //Console.WriteLine(p.ID);

            //var p1 = new Person();
            //Console.WriteLine(p1.ID);

            //var p2 = new Person();
            //Console.WriteLine(p2.ID);

            //var p3= new Person();
            //Console.WriteLine(p3.ID);


            var list = GetPerson();
            foreach(var p in list)
            {
                Console.WriteLine("工号：{0},姓名：{1},性别：{2},生日：{3},手机：{4} 唯一标识：{5}",
                p.EmployeeNo,p.FullName,p.Sex?"男":"女",p.BirthDay.ToString("yyyy年M月d日"),p.Phone,p.ID);

            }
        }
    }
}
